/*


!
!  Dalton, a molecular electronic structure program
!  Copyright (C) The Dalton Authors (see AUTHORS file for details).
!
!  This program is free software; you can redistribute it and/or
!  modify it under the terms of the GNU Lesser General Public
!  License version 2.1 as published by the Free Software Foundation.
!
!  This program is distributed in the hope that it will be useful,
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
!  Lesser General Public License for more details.
!
!  If a copy of the GNU LGPL v2.1 was not distributed with this
!  code, you can obtain one at https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html.
!

!

*/
/*-*-mode: C; c-indentation-style: "bsd"; c-basic-offset: 4; -*-*/
/* fun-pw91nc.c:

   Automatically generated code implementing PW91NC functional and
   its derivatives. It is generated by func-codegen.pl being a part of
   a "Automatic code generation framework for analytical functional
   derivative evaluation", Pawel Salek, 2005

    This functional is connected by making following changes:
    1. add "extern Functional pw91ncFunctional;" to 'functionals.h'
    2. add "&pw91ncFunctional," to 'functionals.c'
    3. add "fun-pw91nc.c" to 'Makefile.am', 'Makefile.in' or 'Makefile'.

    This functional has been generated from following input:
    ------ cut here -------
rho:  rhoa + rhob;
grad: sqrt(grada*grada + gradb*gradb + 2*gradab);
zeta: (rhoa-rhob)/(rhoa+rhob);

c:1.709921;
T:[0.031091,0.015545,0.016887];
U:[0.21370,0.20548,0.11125];
V:[7.5957,14.1189,10.357];
W:[3.5876,6.1977,3.6231];
X:[1.6382,3.3662,0.88026];
Y:[0.49294,0.62517,0.49671];
P:[1,1,1];

r(a,b):=(3/(4*%PI*(a+b)))^(1/3);
zet(a,b):=(a-b)/(a+b);
omega(z):=((1+z)^(4/3)+(1-z)^(4/3)-2)/(2^(4/3)-2);
en(r,t,u,v,w,x,y,p):=-2*t*(1+u*r)*log(1+1/(2*t*(v*sqrt(r)+w*r+x*r^(3/2)+y*r^(p+1))));

eps(a,b):=en(r(a,b),T[1],U[1],V[1],W[1],X[1],Y[1],P[1]);

iota:0.09;
nu:16/%PI*(3*%PI^2)^(1/3);
kappa:0.004235;
lamda:nu*kappa;
Z:-0.001667;
Xi:23.266;
Phi:0.007389;
Lamda:8.723;
Upsilon:0.472;

theta(r):=10^(-3)*(2.568+Xi*r+Phi*r^2)/(1+Lamda*r+Upsilon*r^2+10*Phi*r^3);
phi(r):=theta(r)-Z;
sigma(ga,gb,gab):=ga*ga+gb*gb+2*gab;
d(a,b,ga,gb,gab):=sqrt(sigma(ga,gb,gab))/4/(3/%PI)^(1/6)/(a+b)^(7/6);
A(a,b):=2*iota/lamda*(1/(exp(-2*iota*eps(a,b)/lamda^2)-1));
L(d,a,b):=lamda^2/(2*iota)*log((1+2*(iota*(d^2+A(a,b)*d^4))/(lamda*(1+A(a,b)*d^2+(A(a,b))^2*d^4))));
J(d,a,b):=nu*(phi(r(a,b))-kappa-3*Z/7)*d^2*exp(-100*4/(3*%PI^5*(a+b))^(1/3)*d^2);
H(d,a,b):=L(d,a,b)+J(d,a,b);
    
K(rhoa,grada,rhob,gradb,gradab):=(rhoa+rhob)*(H(d(rhoa,rhob,grada,gradb,gradab),rhoa,rhob));
 

    ------ cut here -------
*/

 
/* strictly conform to XOPEN ANSI C standard */
#if !defined(SYS_DEC)
/* XOPEN compliance is missing on old Tru64 4.0E Alphas and pow() prototype
 * is not specified. */
#define _XOPEN_SOURCE          500
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#include <math.h>
#include <stddef.h>
#include "general.h"

#define __CVERSION__
 
#include "functionals.h"
 
/* INTERFACE PART */
static integer pw91nc_isgga(void) { return 1; } /* FIXME: detect! */
static integer pw91nc_read(const char *conf_line);
static real pw91nc_energy(const FunDensProp* dp);
static void pw91nc_first(FunFirstFuncDrv *ds,   real factor,
                         const FunDensProp* dp);
static void pw91nc_second(FunSecondFuncDrv *ds, real factor,
                          const FunDensProp* dp);
static void pw91nc_third(FunThirdFuncDrv *ds,   real factor,
                         const FunDensProp* dp);
 
Functional PW91ncFunctional = {
  "PW91nc",       /* name */
  pw91nc_isgga,   /* gga-corrected */
   1,
  pw91nc_read,
  NULL,
  pw91nc_energy,
  pw91nc_first,
  pw91nc_second,
  pw91nc_third
};
 
/* IMPLEMENTATION PART */
static integer
pw91nc_read(const char *conf_line)
{
    fun_set_hf_weight(0);
    return 1;
}

static real
pw91nc_energy(const FunDensProp *dp)
{
    real res;
    real rhoa = dp->rhoa, rhob = dp->rhob;
    real grada = dp->grada, gradb = dp->gradb, gradab = dp->gradab;

    real t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
    real t11, t12, t13, t14, t15, t16, t17, t18;
    real t19, t20;

    t1 = rhob+rhoa;
    t2 = pow(gradb,2.0)+2.0*gradab+pow(grada,2.0);
    t3 = 1/pow(t1,2.333333333333333);
    t4 = pow(3.0,0.666666666666667);
    t5 = 1/pow(4.0,0.666666666666667);
    t6 = pow(3.141592653589793,0.666666666666667);
    t7 = 1/t6;
    t8 = 1/pow(t1,0.666666666666667);
    t9 = pow(3.0,0.333333333333333);
    t10 = 1/pow(4.0,0.333333333333333);
    t11 = pow(3.141592653589793,0.333333333333333);
    t12 = 1/t11;
    t13 = 1/pow(t1,0.333333333333333);
    t14 = 1/t4;
    t15 = pow(3.141592653589793,1.333333333333333);
    t16 = 1/t9;
    t17 = pow(t2,2.0);
    t18 = 1/pow(t1,4.666666666666667);
    t19 = pow(2.718281828459045,2.43775691411733*(0.2137*
        t9*t10*t12*t13+1.0)*t14*t6*log(16.0818243221511/(0.49294*t4*
        t5*t7*t8+3.5876*t9*t10*t12*t13+7.5957*pow(3.0,0.166666666666667)/
        (pow(2.0,0.333333333333333)*pow(3.141592653589793,0.166666666666667)*
        pow(t1,0.166666666666667))+0.800428634999363/sqrt(t1))+1.0))-
        1.0;
    t20 = 1/t19;

   /* code */
    res = t1*(t2*t3*(0.001*(23.266*t9*t10*t12*t13+0.007389*
        t4*t5*t7*t8+2.568)/(0.472*t4*t5*t7*t8+8.723*t9*t10*t12*t13+
        0.01763993811759/t1+1.0)-0.001853571428571)/pow(2.718281828459045,
        25.0*t14*t2/(pow(t1,2.666666666666667)*t15))+0.025507875555556*
        log(2.656434474616293*t11*t16*(0.0625*t11*t16*t2*t3+0.010866451862236*
        t17*t18*t20)/(0.166027154663518*t14*t6*t2*t3*t20+0.009188338695221*
        t15*t16*t17*t18/pow(t19,2.0)+1.0)+1.0)*t4*t7);

    return res;
}

static void
pw91nc_first(FunFirstFuncDrv *ds, real factor, const FunDensProp *dp)
{
    real dfdra, dfdrb, dfdga, dfdgb, dfdgab;
    real rhoa = dp->rhoa, rhob = dp->rhob;
    real grada = dp->grada, gradb = dp->gradb, gradab = dp->gradab;

    real t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
    real t11, t12, t13, t14, t15, t16, t17, t18;
    real t19, t20, t21, t22, t23, t24, t25, t26;
    real t27, t28, t29, t30, t31, t32, t33, t34;
    real t35, t36, t37, t38, t39, t40, t41, t42;
    real t43, t44, t45, t46, t47, t48, t49, t50;
    real t51, t52;

    t1 = pow(gradb,2.0)+2.0*gradab+pow(grada,2.0);
    t2 = rhob+rhoa;
    t3 = 1/pow(t2,2.333333333333333);
    t4 = 0.318309886183791;
    t5 = pow(3.0,0.666666666666667);
    t6 = 1/pow(4.0,0.666666666666667);
    t7 = pow(3.141592653589793,0.666666666666667);
    t8 = 1/t7;
    t9 = 1/pow(t2,0.666666666666667);
    t10 = pow(3.0,0.333333333333333);
    t11 = 1/pow(4.0,0.333333333333333);
    t12 = pow(3.141592653589793,0.333333333333333);
    t13 = 1/t12;
    t14 = 1/pow(t2,0.333333333333333);
    t15 = 0.472*t5*t6*t8*t9+0.0554175*t4/t2+8.723*t10*t11*
        t13*t14+1.0;
    t16 = 1/t15;
    t17 = 23.266*t10*t11*t13*t14+0.007389*t5*t6*t8*t9+2.568;
    t18 = 0.001*
        t16*t17-0.001853571428571;
    t19 = 1/t5;
    t20 = pow(3.141592653589793,1.333333333333333);
    t21 = 1/t20;
    t22 = 1/pow(2.718281828459045,25.0*t1*t19*t21/pow(t2,
        2.666666666666667));
    t23 = 1/pow(t2,1.666666666666667);
    t24 = 1/pow(t2,1.333333333333333);
    t25 = pow(t1,2.0);
    t26 = 1/pow(t2,3.333333333333333);
    t27 = 1/t10;
    t28 = 1/pow(t2,4.666666666666667);
    t29 = 0.2137*t10*t11*t13*t14+1.0;
    t30 = 1.732050807568877;
    t31 = 0.564189583547756;
    t32 = sqrt(t2);
    t33 = 1/pow(2.0,0.333333333333333);
    t34 = pow(3.0,0.166666666666667);
    t35 = 1/pow(3.141592653589793,0.166666666666667);
    t36 = 0.49294*t5*t6*t8*t9+7.5957*t33*t34*t35/pow(t2,0.166666666666667)+
        0.8191*t30*t31/t32+3.5876*t10*t11*t13*t14;
    t37 = 16.0818243221511/t36+1.0;
    t38 = log(t37);
    t39 = pow(2.718281828459045,2.43775691411733*t19*t7*t29*
        t38);
    t40 = t39-1.0;
    t41 = 1/t40;
    t42 = 0.010866451862236*t25*t28*t41+0.0625*t1*t12*t27*
        t3;
    t43 = 1/pow(t40,2.0);
    t44 = 0.009188338695221*t27*t20*t25*t28*t43+0.166027154663518*
        t19*t7*t1*t3*t41+1.0;
    t45 = 1/t44;
    t46 = 2.656434474616293*t27*t12*t42*t45+1.0;
    t47 = 1/t46;
    t48 = 1/pow(t2,5.666666666666667);
    t49 = -39.2035784329441*t19*t29*(-1.26595*t33*t34*t35/
        pow(t2,1.166666666666667)-0.40955*t30*t31/pow(t32,3.0)-1.195866666666667*
        t10*t11*t13*t24-0.328626666666667*t5*t6*t8*t23)*t7/(pow(t36,
        2.0)*t37)-0.173649550848958*t27*t11*t12*t24*t38;
    t50 = 1/pow(t44,2.0);
    t51 = t2*(0.025507875555556*t47*t5*(2.656434474616293*
        t12*t27*t45*(-0.010866451862236*t25*t28*t39*t43*t49-0.050710108690434*
        t25*t41*t48-0.145833333333333*t1*t12*t26*t27)-2.656434474616293*
        t12*t27*t42*(-0.018376677390443*t20*t25*t27*t28*t39*t49/pow(t40,
        3.0)-0.042878913911033*t27*t20*t25*t48*t43-0.387396694214876*
        t19*t7*t1*t26*t41-0.166027154663518*t19*t7*t1*t3*t49*t43*t39)*
        t50)*t8+t1*t22*t3*(0.001*t16*(-7.755333333333333*t10*t11*t13*
        t24-0.004926*t5*t6*t8*t23)-0.001*t17*(-0.0554175*t4/pow(t2,
        2.0)-2.907666666666667*t10*t11*t13*t24-0.314666666666667*t5*
        t6*t8*t23)/pow(t15,2.0))-2.333333333333333*t1*t18*t22*t26+
        66.66666666666667*t18*t19*t21*t22*t25/pow(t2,6.0))+0.025507875555556*
        t5*t8*log(t46)+t1*t3*t18*t22;
    t52 = 1/pow(t2,5.0);

   /* code */
    dfdra = t51;
    dfdrb = t51;
    dfdga = t2*(0.025507875555556*t47*t5*t8*(2.656434474616293*
        t12*t27*t45*(0.043465807448944*t1*t28*t41*grada+0.125*t12*
        t27*t3*grada)-2.656434474616293*t27*t12*t42*(0.332054309327037*
        t19*t7*grada*t3*t41+0.036753354780885*t27*t20*grada*t1*t28*
        t43)*t50)-50.0*t1*t18*t19*t21*t22*t52*grada+2.0*t18*t22*t3*
        grada);
    dfdgb = t2*(0.025507875555556*t47*t5*t8*(2.656434474616293*
        t12*t27*t45*(0.043465807448944*t1*t28*t41*gradb+0.125*t12*
        t27*t3*gradb)-2.656434474616293*t27*t12*t42*(0.332054309327037*
        t19*t7*gradb*t3*t41+0.036753354780885*t27*t20*gradb*t1*t28*
        t43)*t50)-50.0*t1*t18*t19*t21*t22*t52*gradb+2.0*t18*t22*t3*
        gradb);
    dfdgab = t2*(0.025507875555556*t47*t5*(2.656434474616293*
        t12*t27*(0.043465807448944*t1*t28*t41+0.125*t12*t27*t3)*t45-
        2.656434474616293*t27*t12*t42*(0.332054309327037*t19*t7*t3*
        t41+0.036753354780885*t27*t20*t1*t28*t43)*t50)*t8-50.0*t1*
        t18*t19*t21*t22*t52+2.0*t18*t22*t3);


    ds->df1000 += factor*dfdra;
    ds->df0100 += factor*dfdrb;
    ds->df0010 += factor*dfdga;
    ds->df0001 += factor*dfdgb;
    ds->df00001+= factor*dfdgab;
   
}

static void
pw91nc_second(FunSecondFuncDrv *ds, real factor, const FunDensProp* dp)
{
    real dfdra, dfdrb, dfdga, dfdgb, dfdgab;
    real d2fdrara, d2fdrarb, d2fdraga, d2fdragb, d2fdraab, d2fdrbrb,
        d2fdrbga, d2fdrbgb, d2fdrbgab, d2fdgaga, d2fdgagb, d2fdgagab,
        d2fdgbgb, d2fdgbgab, d2fdgabgab;
    real rhoa = dp->rhoa, rhob = dp->rhob;
    real grada = dp->grada, gradb = dp->gradb, gradab = dp->gradab;

    real t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
    real t11, t12, t13, t14, t15, t16, t17, t18;
    real t19, t20, t21, t22, t23, t24, t25, t26;
    real t27, t28, t29, t30, t31, t32, t33, t34;
    real t35, t36, t37, t38, t39, t40, t41, t42;
    real t43, t44, t45, t46, t47, t48, t49, t50;
    real t51, t52, t53, t54, t55, t56, t57, t58;
    real t59, t60, t61, t62, t63, t64, t65, t66;
    real t67, t68, t69, t70, t71, t72, t73, t74;
    real t75, t76, t77, t78, t79, t80, t81, t82;
    real t83, t84, t85, t86, t87, t88, t89, t90;
    real t91, t92, t93, t94, t95, t96, t97, t98;
    real t99, t100, t101, t102, t103, t104, t105;

    t1 = pow(grada,2.0);
    t2 = pow(gradb,2.0);
    t3 = 2.0*gradab+t2+t1;
    t4 = rhob+rhoa;
    t5 = 1/pow(t4,2.333333333333333);
    t6 = 0.318309886183791;
    t7 = pow(3.0,0.666666666666667);
    t8 = 1/pow(4.0,0.666666666666667);
    t9 = pow(3.141592653589793,0.666666666666667);
    t10 = 1/t9;
    t11 = 1/pow(t4,0.666666666666667);
    t12 = pow(3.0,0.333333333333333);
    t13 = 1/pow(4.0,0.333333333333333);
    t14 = pow(3.141592653589793,0.333333333333333);
    t15 = 1/t14;
    t16 = 1/pow(t4,0.333333333333333);
    t17 = 0.0554175*t6/t4+8.723*t12*t13*t15*t16+0.472*t7*
        t8*t10*t11+1.0;
    t18 = 1/t17;
    t19 = 23.266*t12*t13*t15*t16+0.007389*t7*t8*t10*t11+2.568;
    t20 = 0.001*
        t18*t19-0.001853571428571;
    t21 = 1/t7;
    t22 = pow(3.141592653589793,1.333333333333333);
    t23 = 1/t22;
    t24 = 1/pow(t4,2.666666666666667);
    t25 = 1/pow(2.718281828459045,25.0*t21*t23*t24*t3);
    t26 = 1/
        pow(t4,1.666666666666667);
    t27 = 1/pow(t4,1.333333333333333);
    t28 = -7.755333333333333*t12*t13*t15*t27-0.004926*t7*
        t8*t10*t26;
    t29 = -0.0554175*t6/pow(t4,2.0)-2.907666666666667*t12*
        t13*t15*t27-0.314666666666667*t7*t8*t10*t26;
    t30 = 1/pow(t17,2.0);
    t31 = 0.001*t18*t28-0.001*t19*t29*t30;
    t32 = pow(t3,2.0);
    t33 = 1/pow(t4,6.0);
    t34 = 1/pow(t4,3.333333333333333);
    t35 = 1/t12;
    t36 = 1/pow(t4,4.666666666666667);
    t37 = 0.2137*t12*t13*t15*t16+1.0;
    t38 = 1.732050807568877;
    t39 = 0.564189583547756;
    t40 = sqrt(t4);
    t41 = 1/pow(2.0,0.333333333333333);
    t42 = pow(3.0,0.166666666666667);
    t43 = 1/pow(3.141592653589793,0.166666666666667);
    t44 = 7.5957*t41*t42*t43/pow(t4,0.166666666666667)+0.8191*
        t38*t39/t40+3.5876*t12*t13*t15*t16+0.49294*t7*t8*t10*t11;
    t45 = 16.0818243221511/
        t44+1.0;
    t46 = log(t45);
    t47 = pow(2.718281828459045,2.43775691411733*t21*t9*t37*
        t46);
    t48 = t47-1.0;
    t49 = 1/t48;
    t50 = 0.0625*t14*t3*t35*t5+0.010866451862236*t32*t36*
        t49;
    t51 = 1/pow(t48,2.0);
    t52 = 0.009188338695221*t35*t22*t32*t36*t51+0.166027154663518*
        t21*t9*t3*t5*t49+1.0;
    t53 = 1/t52;
    t54 = 2.656434474616293*t35*t14*t50*t53+1.0;
    t55 = 1/t54;
    t56 = 1/pow(t4,5.666666666666667);
    t57 = -1.26595*t41*t42*t43/pow(t4,1.166666666666667)-
        0.40955*t38*t39/pow(t40,3.0)-1.195866666666667*t12*t13*t15*
        t27-0.328626666666667*t7*t8*t10*t26;
    t58 = 1/pow(t44,2.0);
    t59 = 1/t45;
    t60 = -0.173649550848958*t35*t13*t14*t27*t46-39.2035784329441*
        t21*t9*t57*t37*t58*t59;
    t61 = -0.010866451862236*t32*t36*t47*t51*t60-0.050710108690434*
        t32*t49*t56-0.145833333333333*t14*t3*t34*t35;
    t62 = 1/pow(t52,2.0);
    t63 = 1/pow(t48,3.0);
    t64 = -0.166027154663518*t21*t9*t3*t5*t60*t51*t47-0.018376677390443*
        t35*t22*t32*t36*t60*t63*t47-0.387396694214876*t21*t9*t3*t34*
        t49-0.042878913911033*t35*t22*t32*t56*t51;
    t65 = 2.656434474616293*t35*t14*t53*t61-2.656434474616293*
        t35*t14*t50*t62*t64;
    t66 = t4*(0.025507875555556*t7*t10*t55*t65-2.333333333333333*
        t20*t25*t3*t34+66.66666666666667*t20*t21*t23*t25*t32*t33+t3*
        t5*t31*t25)+0.025507875555556*t7*t10*log(t54)+t3*t5*t20*t25;
    t67 = 1/
        pow(t4,5.0);
    t68 = -50.0*t20*t21*t23*t25*t3*t67*grada;
    t69 = 2.0*t20*t25*t5*grada;
    t70 = 0.332054309327037*t21*t9*grada*t5*t49+0.036753354780885*
        t35*t22*grada*t3*t36*t51;
    t71 = 0.125*t14*t35*t5*grada+0.043465807448944*t3*t36*
        t49*grada;
    t72 = 2.656434474616293*t35*t14*t71*t53-2.656434474616293*
        t35*t14*t50*t70*t62;
    t73 = 0.025507875555556*t7*t10*t72*t55;
    t74 = -50.0*t20*t21*t23*t25*t3*t67*gradb;
    t75 = 2.0*t20*t25*t5*gradb;
    t76 = 0.332054309327037*t21*t9*gradb*t5*t49+0.036753354780885*
        t35*t22*gradb*t3*t36*t51;
    t77 = 0.125*t14*t35*t5*gradb+0.043465807448944*t3*t36*
        t49*gradb;
    t78 = 2.656434474616293*t35*t14*t77*t53-2.656434474616293*
        t35*t14*t50*t76*t62;
    t79 = 0.025507875555556*t7*t10*t78*t55;
    t80 = -50.0*t20*t21*t23*t25*t3*t67;
    t81 = 2.0*t20*t25*t5;
    t82 = 0.036753354780885*t35*t22*t3*t36*t51;
    t83 = 0.332054309327037*t21*t9*t5*t49;
    t84 = t83+t82;
    t85 = 0.125*t14*t35*t5;
    t86 = 0.043465807448944*t3*t36*t49;
    t87 = t86+t85;
    t88 = 2.656434474616293*t35*t14*t87*t53-2.656434474616293*
        t35*t14*t50*t84*t62;
    t89 = 0.025507875555556*t7*t10*t88*t55;
    t90 = 1/pow(3.141592653589793,2.666666666666667);
    t91 = 1/pow(t4,4.333333333333333);
    t92 = 1/pow(t54,2.0);
    t93 = 1/pow(t52,3.0);
    t94 = 1/pow(t4,6.666666666666667);
    t95 = pow(t57,2.0);
    t96 = 78.40715686588821*t21*t37*t59*t9*t95/pow(t44,3.0)-
        630.4650611582789*t21*t37*t9*t95/(pow(t44,4.0)*pow(t45,2.0))-
        39.2035784329441*t21*t37*(1.594488888888889*t12*t13*t15*t5+
        1.476941666666667*t41*t42*t43/pow(t4,2.166666666666667)+0.614325*
        t38*t39/pow(t40,5.0)+0.547711111111111*t7*t8*t10*t24)*t58*
        t59*t9+5.58520314074677*t35*t13*t14*t27*t57*t58*t59+0.231532734465277*
        t35*t13*t14*t5*t46;
    t97 = pow(t60,2.0);
    t98 = pow(2.718281828459045,4.875513828234661*t21*t9*
        t37*t46);
    t99 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(0.021732903724472*t32*t36*t63*t97*t98-0.010866451862236*
        t32*t36*t47*t51*t97-0.010866451862236*t32*t36*t47*t51*t96+
        0.287357282579128*t32*t49*t94+0.486111111111111*t14*t3*t35*
        t91+0.101420217380869*t32*t47*t51*t56*t60)-2.656434474616293*
        t14*t35*t50*t62*(0.055130032171328*t22*t32*t35*t36*t97*t98/
        pow(t48,4.0)+0.332054309327037*t21*t9*t3*t5*t97*t63*t98+0.242980512162518*
        t35*t22*t32*t94*t51+1.291322314049587*t21*t9*t3*t91*t49-0.018376677390443*
        t35*t22*t32*t36*t97*t63*t47-0.018376677390443*t35*t22*t32*
        t36*t96*t63*t47+0.17151565564413*t35*t22*t32*t56*t60*t63*t47-
        0.166027154663518*t21*t9*t3*t5*t97*t51*t47-0.166027154663518*
        t21*t9*t3*t5*t96*t51*t47+0.774793388429752*t21*t9*t3*t34*t60*
        t51*t47)+5.312868949232586*t14*t35*t50*pow(t64,2.0)*t93-5.312868949232586*
        t35*t14*t62*t61*t64)-0.025507875555556*t10*pow(t65,2.0)*t7*
        t92+7.777777777777778*t20*t25*t3*t91+1481.481481481482*t20*
        t25*pow(t3,3.0)*t35*t90/pow(t4,9.666666666666666)+t25*t3*t5*
        (-0.001*t19*t30*(0.110835*t6/pow(t4,3.0)+3.876888888888889*
        t12*t13*t15*t5+0.524444444444444*t7*t8*t10*t24)+0.001*t18*
        (10.34044444444444*t12*t13*t15*t5+0.00821*t7*t8*t10*t24)-0.002*
        t28*t29*t30+0.002*t19*pow(t29,2.0)/pow(t17,3.0))-555.5555555555555*
        t20*t21*t23*t25*t32/pow(t4,7.0)-4.666666666666667*t25*t3*t31*
        t34+133.3333333333333*t21*t23*t25*t31*t32*t33)+0.051015751111111*
        t7*t10*t55*t65+2.0*t25*t3*t31*t5-4.666666666666667*t20*t25*
        t3*t34+133.3333333333333*t20*t21*t23*t25*t32*t33;
    t100 = 1/pow(t4,8.666666666666666);
    t101 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(-0.043465807448944*t3*t36*t47*t51*t60*grada-0.202840434761738*
        t3*t49*t56*grada-0.291666666666667*t14*t34*t35*grada)+5.312868949232586*
        t35*t14*t50*t70*t93*t64-2.656434474616293*t35*t14*t71*t62*
        t64-2.656434474616293*t35*t14*t70*t62*t61-2.656434474616293*
        t35*t14*t50*t62*(-0.332054309327037*t21*t9*grada*t5*t60*t51*
        t47-0.07350670956177*t35*t22*grada*t3*t36*t60*t63*t47-0.774793388429752*
        t21*t9*grada*t34*t49-0.17151565564413*t35*t22*grada*t3*t56*
        t51))-1111.111111111111*t100*t20*t25*t32*t35*t90*grada-50.0*
        t21*t23*t25*t3*t31*t67*grada+2.0*t25*t31*t5*grada-4.666666666666667*
        t20*t25*t34*grada+383.3333333333333*t20*t21*t23*t25*t3*t33*
        grada-0.025507875555556*t7*t10*t72*t92*t65)+t73+t69+t68;
    t102 = t4*
        (0.025507875555556*t10*t55*t7*(2.656434474616293*t14*t35*t53*
        (-0.043465807448944*t3*t36*t47*t51*t60*gradb-0.202840434761738*
        t3*t49*t56*gradb-0.291666666666667*t14*t34*t35*gradb)+5.312868949232586*
        t35*t14*t50*t76*t93*t64-2.656434474616293*t35*t14*t77*t62*
        t64-2.656434474616293*t35*t14*t76*t62*t61-2.656434474616293*
        t35*t14*t50*t62*(-0.332054309327037*t21*t9*gradb*t5*t60*t51*
        t47-0.07350670956177*t35*t22*gradb*t3*t36*t60*t63*t47-0.774793388429752*
        t21*t9*gradb*t34*t49-0.17151565564413*t35*t22*gradb*t3*t56*
        t51))-1111.111111111111*t100*t20*t25*t32*t35*t90*gradb-50.0*
        t21*t23*t25*t3*t31*t67*gradb+2.0*t25*t31*t5*gradb-4.666666666666667*
        t20*t25*t34*gradb+383.3333333333333*t20*t21*t23*t25*t3*t33*
        gradb-0.025507875555556*t7*t10*t78*t92*t65)+t79+t75+t74;
    t103 = t4*
        (-1111.111111111111*t100*t20*t25*t32*t35*t90+0.025507875555556*
        t10*t55*(5.312868949232586*t35*t14*t50*t84*t93*t64-2.656434474616293*
        t35*t14*t87*t62*t64-2.656434474616293*t35*t14*t84*t62*t61+
        2.656434474616293*t14*t35*t53*(-0.043465807448944*t3*t36*t47*
        t51*t60-0.202840434761738*t3*t49*t56-0.291666666666667*t14*
        t34*t35)-2.656434474616293*t35*t14*t50*t62*(-0.332054309327037*
        t21*t9*t5*t60*t51*t47-0.07350670956177*t35*t22*t3*t36*t60*
        t63*t47-0.774793388429752*t21*t9*t34*t49-0.17151565564413*
        t35*t22*t3*t56*t51))*t7-50.0*t21*t23*t25*t3*t31*t67-0.025507875555556*
        t7*t10*t88*t92*t65+2.0*t25*t31*t5-4.666666666666667*t20*t25*
        t34+383.3333333333333*t20*t21*t23*t25*t3*t33)+t89+t81+t80;
    t104 = 1/
        pow(t4,7.666666666666667);
    t105 = pow(3.141592653589793,1.666666666666667);

   /* code */
    dfdra = t66;
    dfdrb = t66;
    dfdga = t4*(t73+t69+t68);
    dfdgb = t4*(t79+t75+t74);
    dfdgab = t4*(t89+t81+t80);
    d2fdrara = t99;
    d2fdrarb = t99;
    d2fdraga = t101;
    d2fdragb = t102;
    d2fdraab = t103;
    d2fdrbrb = t99;
    d2fdrbga = t101;
    d2fdrbgb = t102;
    d2fdrbgab = t103;
    d2fdgaga = t4*(0.025507875555556*t10*t55*t7*(5.312868949232586*
        t14*t35*t50*pow(t70,2.0)*t93+2.656434474616293*t14*t35*t53*
        (t86+t85+0.086931614897888*t1*t36*t49)-2.656434474616293*t35*
        t14*t50*(t83+t82+0.07350670956177*t35*t22*t1*t36*t51)*t62-
        5.312868949232586*t35*t14*t71*t70*t62)-0.025507875555556*t10*
        t7*pow(t72,2.0)*t92+833.3333333333334*t1*t104*t20*t25*t3*t35*
        t90+t81+t80-200.0*t1*t20*t21*t23*t25*t67);
    d2fdgagb = t4*(833.3333333333334*t104*t20*t25*t3*t35*
        t90*grada*gradb-200.0*t20*t21*t23*t25*t67*grada*gradb-0.025507875555556*
        t7*t10*t72*t78*t92+0.025507875555556*t7*t10*t55*(0.07350670956177*
        t35*t22*grada*gradb*t36*t53*t49-0.195265757395493*t21*t105*
        grada*gradb*t36*t50*t62*t51-2.656434474616293*t35*t14*t71*
        t76*t62-2.656434474616293*t35*t14*t77*t70*t62+5.312868949232586*
        t35*t14*t50*t70*t76*t93));
    d2fdgagab = t4*(833.3333333333334*t104*t20*t25*t3*t35*
        t90*grada-200.0*t20*t21*t23*t25*t67*grada-0.025507875555556*
        t7*t10*t88*t72*t92+0.025507875555556*t7*t10*t55*(0.07350670956177*
        t35*t22*grada*t36*t53*t49-0.195265757395493*t21*t105*grada*
        t36*t50*t62*t51-2.656434474616293*t35*t14*t87*t70*t62-2.656434474616293*
        t35*t14*t71*t84*t62+5.312868949232586*t35*t14*t50*t84*t70*
        t93));
    d2fdgbgb = t4*(0.025507875555556*t10*t55*t7*(5.312868949232586*
        t14*t35*t50*pow(t76,2.0)*t93+2.656434474616293*t14*t35*t53*
        (t86+t85+0.086931614897888*t2*t36*t49)-2.656434474616293*t35*
        t14*t50*(t83+t82+0.07350670956177*t35*t22*t2*t36*t51)*t62-
        5.312868949232586*t35*t14*t77*t76*t62)-0.025507875555556*t10*
        t7*pow(t78,2.0)*t92+833.3333333333334*t104*t2*t20*t25*t3*t35*
        t90+t81+t80-200.0*t2*t20*t21*t23*t25*t67);
    d2fdgbgab = t4*(833.3333333333334*t104*t20*t25*t3*t35*
        t90*gradb-200.0*t20*t21*t23*t25*t67*gradb-0.025507875555556*
        t7*t10*t88*t78*t92+0.025507875555556*t7*t10*t55*(0.07350670956177*
        t35*t22*gradb*t36*t53*t49-0.195265757395493*t21*t105*gradb*
        t36*t50*t62*t51-2.656434474616293*t35*t14*t87*t76*t62-2.656434474616293*
        t35*t14*t77*t84*t62+5.312868949232586*t35*t14*t50*t84*t76*
        t93));
    d2fdgabgab = t4*(0.025507875555556*t10*t55*t7*(5.312868949232586*
        t14*t35*t50*pow(t84,2.0)*t93-5.312868949232586*t35*t14*t87*
        t84*t62-0.195265757395493*t21*t105*t36*t50*t62*t51+0.07350670956177*
        t35*t22*t36*t53*t49)-0.025507875555556*t10*t7*pow(t88,2.0)*
        t92+833.3333333333334*t104*t20*t25*t3*t35*t90-200.0*t20*t21*
        t23*t25*t67);


    ds->df1000 += factor*dfdra;
    ds->df0100 += factor*dfdrb;
    ds->df0010 += factor*dfdga;
    ds->df0001 += factor*dfdgb;
    ds->df00001+= factor*dfdgab;

    ds->df2000 += factor*d2fdrara;
    ds->df1100 += factor*d2fdrarb;
    ds->df1010 += factor*d2fdraga;
    ds->df1001 += factor*d2fdragb;
    ds->df10001+= factor*d2fdraab;
    ds->df0200 += factor*d2fdrbrb;
    ds->df0110 += factor*d2fdrbga;
    ds->df0101 += factor*d2fdrbgb;
    ds->df01001+= factor*d2fdrbgab;
    ds->df0020 += factor*d2fdgaga;
    ds->df0011 += factor*d2fdgagb;
    ds->df00101+= factor*d2fdgagab;
    ds->df0002 += factor*d2fdgbgb;
    ds->df00011+= factor*d2fdgbgab;
    ds->df00002+= factor*d2fdgabgab;

}

static void
pw91nc_third(FunThirdFuncDrv *ds, real factor, const FunDensProp* dp)
{
    real dfdra, dfdrb, dfdga, dfdgb, dfdgab;
    real d2fdrara, d2fdrarb, d2fdraga, d2fdragb, d2fdraab, d2fdrbrb,
        d2fdrbga, d2fdrbgb, d2fdrbgab, d2fdgaga, d2fdgagb, d2fdgagab,
        d2fdgbgb, d2fdgbgab, d2fdgabgab;
    real d3fdrarara, d3fdrararb, d3fdraraga, d3fdraragb, d3fdraraab,
         d3fdrarbrb, d3fdrarbga, d3fdrarbgb, d3fdrarbab, d3fdragaga,
         d3fdragagb, d3fdragaab, d3fdragbgb, d3fdragbab, d3fdraabab,
         d3fdrbrbrb, d3fdrbrbga, d3fdrbrbgb, d3fdrbrbab, d3fdrbgaga,
         d3fdrbgagb, d3fdrbgaab, d3fdrbgbgb, d3fdrbgbab, d3fdrbabab,
         d3fdgagaga, d3fdgagagb, d3fdgagaab, d3fdgagbgb, d3fdgagbab,
         d3fdgaabab, d3fdgbgbgb, d3fdgbgbab, d3fdgbabab, d3fdababab;
    real rhoa = dp->rhoa, rhob = dp->rhob;
    real grada = dp->grada, gradb = dp->gradb, gradab = dp->gradab;

    real t1, t2, t3, t4, t5, t6, t7, t8, t9, t10;
    real t11, t12, t13, t14, t15, t16, t17, t18;
    real t19, t20, t21, t22, t23, t24, t25, t26;
    real t27, t28, t29, t30, t31, t32, t33, t34;
    real t35, t36, t37, t38, t39, t40, t41, t42;
    real t43, t44, t45, t46, t47, t48, t49, t50;
    real t51, t52, t53, t54, t55, t56, t57, t58;
    real t59, t60, t61, t62, t63, t64, t65, t66;
    real t67, t68, t69, t70, t71, t72, t73, t74;
    real t75, t76, t77, t78, t79, t80, t81, t82;
    real t83, t84, t85, t86, t87, t88, t89, t90;
    real t91, t92, t93, t94, t95, t96, t97, t98;
    real t99, t100, t101, t102, t103, t104, t105;
    real t106, t107, t108, t109, t110, t111, t112;
    real t113, t114, t115, t116, t117, t118, t119;
    real t120, t121, t122, t123, t124, t125, t126;
    real t127, t128, t129, t130, t131, t132, t133;
    real t134, t135, t136, t137, t138, t139, t140;
    real t141, t142, t143, t144, t145, t146, t147;
    real t148, t149, t150, t151, t152, t153, t154;
    real t155, t156, t157, t158, t159, t160, t161;
    real t162, t163, t164, t165, t166, t167, t168;
    real t169, t170, t171, t172, t173, t174, t175;
    real t176, t177, t178, t179, t180, t181, t182;
    real t183, t184, t185, t186, t187, t188, t189;
    real t190, t191, t192, t193, t194, t195, t196;
    real t197, t198, t199, t200, t201, t202, t203;
    real t204, t205, t206, t207, t208, t209, t210;
    real t211, t212, t213, t214, t215;

    t1 = pow(grada,2.0);
    t2 = pow(gradb,2.0);
    t3 = 2.0*gradab+t2+t1;
    t4 = rhob+rhoa;
    t5 = 1/pow(t4,2.333333333333333);
    t6 = 0.318309886183791;
    t7 = pow(3.0,0.666666666666667);
    t8 = 1/pow(4.0,0.666666666666667);
    t9 = pow(3.141592653589793,0.666666666666667);
    t10 = 1/t9;
    t11 = 1/pow(t4,0.666666666666667);
    t12 = pow(3.0,0.333333333333333);
    t13 = 1/pow(4.0,0.333333333333333);
    t14 = pow(3.141592653589793,0.333333333333333);
    t15 = 1/t14;
    t16 = 1/pow(t4,0.333333333333333);
    t17 = 0.0554175*t6/t4+8.723*t12*t13*t15*t16+0.472*t7*
        t8*t10*t11+1.0;
    t18 = 1/t17;
    t19 = 23.266*t12*t13*t15*t16+0.007389*t7*t8*t10*t11+2.568;
    t20 = 0.001*
        t18*t19-0.001853571428571;
    t21 = 1/t7;
    t22 = pow(3.141592653589793,1.333333333333333);
    t23 = 1/t22;
    t24 = 1/pow(t4,2.666666666666667);
    t25 = 1/pow(2.718281828459045,25.0*t21*t23*t24*t3);
    t26 = 1/
        pow(t4,1.666666666666667);
    t27 = 1/pow(t4,1.333333333333333);
    t28 = -7.755333333333333*t12*t13*t15*t27-0.004926*t7*
        t8*t10*t26;
    t29 = -0.0554175*t6/pow(t4,2.0)-2.907666666666667*t12*
        t13*t15*t27-0.314666666666667*t7*t8*t10*t26;
    t30 = 1/pow(t17,2.0);
    t31 = 0.001*t18*t28-0.001*t19*t29*t30;
    t32 = pow(t3,2.0);
    t33 = 1/pow(t4,6.0);
    t34 = 1/pow(t4,3.333333333333333);
    t35 = 1/t12;
    t36 = 1/pow(t4,4.666666666666667);
    t37 = 0.2137*t12*t13*t15*t16+1.0;
    t38 = 1.732050807568877;
    t39 = 0.564189583547756;
    t40 = sqrt(t4);
    t41 = 1/pow(2.0,0.333333333333333);
    t42 = pow(3.0,0.166666666666667);
    t43 = 1/pow(3.141592653589793,0.166666666666667);
    t44 = 7.5957*t41*t42*t43/pow(t4,0.166666666666667)+0.8191*
        t38*t39/t40+3.5876*t12*t13*t15*t16+0.49294*t7*t8*t10*t11;
    t45 = 16.0818243221511/
        t44+1.0;
    t46 = log(t45);
    t47 = pow(2.718281828459045,2.43775691411733*t21*t9*t37*
        t46);
    t48 = t47-1.0;
    t49 = 1/t48;
    t50 = 0.0625*t14*t3*t35*t5+0.010866451862236*t32*t36*
        t49;
    t51 = 1/pow(t48,2.0);
    t52 = 0.009188338695221*t35*t22*t32*t36*t51+0.166027154663518*
        t21*t9*t3*t5*t49+1.0;
    t53 = 1/t52;
    t54 = 2.656434474616293*t35*t14*t50*t53+1.0;
    t55 = 1/t54;
    t56 = 1/pow(t4,5.666666666666667);
    t57 = -1.26595*t41*t42*t43/pow(t4,1.166666666666667)-
        0.40955*t38*t39/pow(t40,3.0)-1.195866666666667*t12*t13*t15*
        t27-0.328626666666667*t7*t8*t10*t26;
    t58 = 1/pow(t44,2.0);
    t59 = 1/t45;
    t60 = -0.173649550848958*t35*t13*t14*t27*t46-39.2035784329441*
        t21*t9*t57*t37*t58*t59;
    t61 = -0.010866451862236*t32*t36*t47*t51*t60-0.050710108690434*
        t32*t49*t56-0.145833333333333*t14*t3*t34*t35;
    t62 = 1/pow(t52,2.0);
    t63 = 1/pow(t48,3.0);
    t64 = -0.166027154663518*t21*t9*t3*t5*t60*t51*t47-0.018376677390443*
        t35*t22*t32*t36*t60*t63*t47-0.387396694214876*t21*t9*t3*t34*
        t49-0.042878913911033*t35*t22*t32*t56*t51;
    t65 = 2.656434474616293*t35*t14*t53*t61-2.656434474616293*
        t35*t14*t50*t62*t64;
    t66 = t4*(0.025507875555556*t7*t10*t55*t65-2.333333333333333*
        t20*t25*t3*t34+66.66666666666667*t20*t21*t23*t25*t32*t33+t3*
        t5*t31*t25)+0.025507875555556*t7*t10*log(t54)+t3*t5*t20*t25;
    t67 = 1/
        pow(t4,5.0);
    t68 = -50.0*t20*t21*t23*t25*t3*t67*grada;
    t69 = 2.0*t20*t25*t5*grada;
    t70 = 0.332054309327037*t21*t9*grada*t5*t49+0.036753354780885*
        t35*t22*grada*t3*t36*t51;
    t71 = 0.125*t14*t35*t5*grada+0.043465807448944*t3*t36*
        t49*grada;
    t72 = 2.656434474616293*t35*t14*t71*t53-2.656434474616293*
        t35*t14*t50*t70*t62;
    t73 = 0.025507875555556*t7*t10*t72*t55;
    t74 = -50.0*t20*t21*t23*t25*t3*t67*gradb;
    t75 = 2.0*t20*t25*t5*gradb;
    t76 = 0.332054309327037*t21*t9*gradb*t5*t49+0.036753354780885*
        t35*t22*gradb*t3*t36*t51;
    t77 = 0.125*t14*t35*t5*gradb+0.043465807448944*t3*t36*
        t49*gradb;
    t78 = 2.656434474616293*t35*t14*t77*t53-2.656434474616293*
        t35*t14*t50*t76*t62;
    t79 = 0.025507875555556*t7*t10*t78*t55;
    t80 = -50.0*t20*t21*t23*t25*t3*t67;
    t81 = 2.0*t20*t25*t5;
    t82 = 0.036753354780885*t35*t22*t3*t36*t51;
    t83 = 0.332054309327037*t21*t9*t5*t49;
    t84 = t83+t82;
    t85 = 0.125*t14*t35*t5;
    t86 = 0.043465807448944*t3*t36*t49;
    t87 = t86+t85;
    t88 = 2.656434474616293*t35*t14*t87*t53-2.656434474616293*
        t35*t14*t50*t84*t62;
    t89 = 0.025507875555556*t7*t10*t88*t55;
    t90 = 10.34044444444444*t12*t13*t15*t5+0.00821*t7*t8*
        t10*t24;
    t91 = pow(t29,2.0);
    t92 = 1/pow(t17,3.0);
    t93 = 0.110835*t6/pow(t4,3.0)+3.876888888888889*t12*t13*
        t15*t5+0.524444444444444*t7*t8*t10*t24;
    t94 = -0.001*t19*t30*t93+0.002*t19*t91*t92+0.001*t18*
        t90-0.002*t28*t29*t30;
    t95 = 1/pow(3.141592653589793,2.666666666666667);
    t96 = pow(t3,3.0);
    t97 = 1/pow(t4,9.666666666666666);
    t98 = 1/pow(t4,7.0);
    t99 = 1/pow(t4,4.333333333333333);
    t100 = 1/pow(t54,2.0);
    t101 = pow(t65,2.0);
    t102 = 1/pow(t52,3.0);
    t103 = pow(t64,2.0);
    t104 = 1/pow(t4,6.666666666666667);
    t105 = pow(t57,2.0);
    t106 = 1/pow(t44,4.0);
    t107 = 1/pow(t45,2.0);
    t108 = 1/pow(t44,3.0);
    t109 = 1.594488888888889*t12*t13*t15*t5+1.476941666666667*
        t41*t42*t43/pow(t4,2.166666666666667)+0.614325*t38*t39/pow(t40,
        5.0)+0.547711111111111*t7*t8*t10*t24;
    t110 = 0.231532734465277*t35*t13*t14*t5*t46-39.2035784329441*
        t21*t9*t109*t37*t58*t59+5.58520314074677*t35*t13*t14*t27*t57*
        t58*t59+78.40715686588821*t21*t9*t105*t37*t108*t59-630.4650611582789*
        t21*t9*t105*t37*t106*t107;
    t111 = pow(t60,2.0);
    t112 = pow(2.718281828459045,4.875513828234661*t21*t9*
        t37*t46);
    t113 = 0.486111111111111*t14*t3*t35*t99+0.021732903724472*
        t111*t112*t32*t36*t63+0.101420217380869*t32*t47*t51*t56*t60-
        0.010866451862236*t111*t32*t36*t47*t51-0.010866451862236*t110*
        t32*t36*t47*t51+0.287357282579128*t104*t32*t49;
    t114 = 1/pow(t48,4.0);
    t115 = 0.332054309327037*t21*t9*t3*t5*t111*t63*t112+0.055130032171328*
        t35*t22*t32*t36*t111*t114*t112-0.166027154663518*t21*t9*t3*
        t5*t111*t51*t47+0.774793388429752*t21*t9*t3*t34*t60*t51*t47-
        0.166027154663518*t21*t9*t3*t5*t110*t51*t47-0.018376677390443*
        t35*t22*t32*t36*t111*t63*t47+0.17151565564413*t35*t22*t32*
        t56*t60*t63*t47-0.018376677390443*t35*t22*t32*t36*t110*t63*
        t47+1.291322314049587*t21*t9*t3*t99*t49+0.242980512162518*
        t35*t22*t32*t104*t51;
    t116 = -2.656434474616293*t35*t14*t50*t62*t115+2.656434474616293*
        t35*t14*t53*t113+5.312868949232586*t35*t14*t50*t102*t103-5.312868949232586*
        t35*t14*t62*t61*t64;
    t117 = t4*(7.777777777777778*t20*t25*t3*t99-555.5555555555555*
        t20*t21*t23*t25*t32*t98+1481.481481481482*t20*t25*t35*t95*
        t96*t97-4.666666666666667*t25*t3*t31*t34+133.3333333333333*
        t21*t23*t25*t31*t32*t33+t3*t5*t94*t25+0.025507875555556*t7*
        t10*t55*t116-0.025507875555556*t7*t10*t100*t101)+0.051015751111111*
        t7*t10*t55*t65+2.0*t25*t3*t31*t5-4.666666666666667*t20*t25*
        t3*t34+133.3333333333333*t20*t21*t23*t25*t32*t33;
    t118 = 1/pow(t4,8.666666666666666);
    t119 = -0.043465807448944*t3*t36*t47*t51*t60*grada-0.202840434761738*
        t3*t49*t56*grada-0.291666666666667*t14*t34*t35*grada;
    t120 = -0.332054309327037*t21*t9*grada*t5*t60*t51*t47-
        0.07350670956177*t35*t22*grada*t3*t36*t60*t63*t47-0.774793388429752*
        t21*t9*grada*t34*t49-0.17151565564413*t35*t22*grada*t3*t56*
        t51;
    t121 = -2.656434474616293*t35*t14*t71*t62*t64+5.312868949232586*
        t35*t14*t50*t70*t102*t64-2.656434474616293*t35*t14*t50*t62*
        t120-2.656434474616293*t35*t14*t70*t62*t61+2.656434474616293*
        t35*t14*t53*t119;
    t122 = t4*(-1111.111111111111*t118*t20*t25*t32*t35*t95*
        grada-50.0*t21*t23*t25*t3*t31*t67*grada+2.0*t25*t31*t5*grada-
        4.666666666666667*t20*t25*t34*grada+383.3333333333333*t20*
        t21*t23*t25*t3*t33*grada-0.025507875555556*t7*t10*t72*t100*
        t65+0.025507875555556*t7*t10*t55*t121)+t73+t69+t68;
    t123 = -0.043465807448944*t3*t36*t47*t51*t60*gradb-0.202840434761738*
        t3*t49*t56*gradb-0.291666666666667*t14*t34*t35*gradb;
    t124 = -0.332054309327037*t21*t9*gradb*t5*t60*t51*t47-
        0.07350670956177*t35*t22*gradb*t3*t36*t60*t63*t47-0.774793388429752*
        t21*t9*gradb*t34*t49-0.17151565564413*t35*t22*gradb*t3*t56*
        t51;
    t125 = -2.656434474616293*t35*t14*t77*t62*t64+5.312868949232586*
        t35*t14*t50*t76*t102*t64-2.656434474616293*t35*t14*t50*t62*
        t124-2.656434474616293*t35*t14*t76*t62*t61+2.656434474616293*
        t35*t14*t53*t123;
    t126 = t4*(-1111.111111111111*t118*t20*t25*t32*t35*t95*
        gradb-50.0*t21*t23*t25*t3*t31*t67*gradb+2.0*t25*t31*t5*gradb-
        4.666666666666667*t20*t25*t34*gradb+383.3333333333333*t20*
        t21*t23*t25*t3*t33*gradb-0.025507875555556*t7*t10*t78*t100*
        t65+0.025507875555556*t7*t10*t55*t125)+t79+t75+t74;
    t127 = -50.0*t21*t23*t25*t3*t31*t67;
    t128 = 2.0*t25*t31*t5;
    t129 = -1111.111111111111*t118*t20*t25*t32*t35*t95;
    t130 = 383.3333333333333*
        t20*t21*t23*t25*t3*t33;
    t131 = -4.666666666666667*t20*t25*t34;
    t132 = -0.291666666666667*t14*t34*t35;
    t133 = -0.202840434761738*t3*t49*t56;
    t134 = -0.043465807448944*t3*t36*t47*t51*t60;
    t135 = t134+t133+t132;
    t136 = -0.17151565564413*t35*t22*t3*t56*t51;
    t137 = -0.774793388429752*t21*t9*t34*t49;
    t138 = -0.07350670956177*t35*t22*t3*t36*t60*t63*t47;
    t139 = -
        0.332054309327037*t21*t9*t5*t60*t51*t47;
    t140 = t139+t138+t137+t136;
    t141 = -2.656434474616293*t35*t14*t87*t62*t64+5.312868949232586*
        t35*t14*t50*t84*t102*t64-2.656434474616293*t35*t14*t50*t62*
        t140-2.656434474616293*t35*t14*t84*t62*t61+2.656434474616293*
        t35*t14*t53*t135;
    t142 = t4*(-0.025507875555556*t7*t10*t88*t100*t65+0.025507875555556*
        t7*t10*t55*t141+t131+t130+t129+t128+t127)+t89+t81+t80;
    t143 = 1/pow(t4,7.666666666666667);
    t144 = 833.3333333333334*t1*t143*t20*t25*t3*t35*t95;
    t145 = -
        200.0*t1*t20*t21*t23*t25*t67;
    t146 = pow(t72,2.0);
    t147 = -0.025507875555556*t7*t10*t146*t100;
    t148 = pow(t70,2.0);
    t149 = t83+t82+0.07350670956177*t35*t22*t1*t36*t51;
    t150 = t86+
        t85+0.086931614897888*t1*t36*t49;
    t151 = 2.656434474616293*t35*t14*t150*t53-5.312868949232586*
        t35*t14*t71*t70*t62-2.656434474616293*t35*t14*t50*t149*t62+
        5.312868949232586*t35*t14*t50*t148*t102;
    t152 = 0.025507875555556*t7*t10*t151*t55;
    t153 = 833.3333333333334*t143*t20*t25*t3*t35*t95*grada*
        gradb;
    t154 = -200.0*t20*t21*t23*t25*t67*grada*gradb;
    t155 = -0.025507875555556*t7*t10*t72*t78*t100;
    t156 = pow(3.141592653589793,1.666666666666667);
    t157 = 0.07350670956177*t35*t22*grada*gradb*t36*t53*t49-
        0.195265757395493*t21*t156*grada*gradb*t36*t50*t62*t51-2.656434474616293*
        t35*t14*t71*t76*t62-2.656434474616293*t35*t14*t77*t70*t62+
        5.312868949232586*t35*t14*t50*t70*t76*t102;
    t158 = 0.025507875555556*t7*t10*t55*t157;
    t159 = 833.3333333333334*t143*t20*t25*t3*t35*t95*grada;
    t160 = -
        200.0*t20*t21*t23*t25*t67*grada;
    t161 = -0.025507875555556*t7*t10*t88*t72*t100;
    t162 = -0.195265757395493*t21*t156*grada*t36*t50*t62*
        t51;
    t163 = 0.07350670956177*t35*t22*grada*t36*t53*t49;
    t164 = t163+t162-2.656434474616293*t35*t14*t87*t70*t62-
        2.656434474616293*t35*t14*t71*t84*t62+5.312868949232586*t35*
        t14*t50*t84*t70*t102;
    t165 = 0.025507875555556*t7*t10*t55*t164;
    t166 = 833.3333333333334*t143*t2*t20*t25*t3*t35*t95;
    t167 = -
        200.0*t2*t20*t21*t23*t25*t67;
    t168 = pow(t78,2.0);
    t169 = -0.025507875555556*t7*t10*t168*t100;
    t170 = pow(t76,2.0);
    t171 = t83+t82+0.07350670956177*t35*t22*t2*t36*t51;
    t172 = t86+
        t85+0.086931614897888*t2*t36*t49;
    t173 = 2.656434474616293*t35*t14*t172*t53-5.312868949232586*
        t35*t14*t77*t76*t62-2.656434474616293*t35*t14*t50*t171*t62+
        5.312868949232586*t35*t14*t50*t170*t102;
    t174 = 0.025507875555556*t7*t10*t173*t55;
    t175 = 833.3333333333334*t143*t20*t25*t3*t35*t95*gradb;
    t176 = -
        200.0*t20*t21*t23*t25*t67*gradb;
    t177 = -0.025507875555556*t7*t10*t88*t78*t100;
    t178 = -0.195265757395493*t21*t156*gradb*t36*t50*t62*
        t51;
    t179 = 0.07350670956177*t35*t22*gradb*t36*t53*t49;
    t180 = t179+t178-2.656434474616293*t35*t14*t87*t76*t62-
        2.656434474616293*t35*t14*t77*t84*t62+5.312868949232586*t35*
        t14*t50*t84*t76*t102;
    t181 = 0.025507875555556*t7*t10*t55*t180;
    t182 = 833.3333333333334*t143*t20*t25*t3*t35*t95;
    t183 = -200.0*t20*t21*t23*t25*t67;
    t184 = pow(t88,2.0);
    t185 = -0.025507875555556*t7*t10*t184*t100;
    t186 = pow(t84,2.0);
    t187 = -0.195265757395493*t21*t156*t36*t50*t62*t51;
    t188 = 0.07350670956177*
        t35*t22*t36*t53*t49;
    t189 = t188+t187-5.312868949232586*t35*t14*t87*t84*t62+
        5.312868949232586*t35*t14*t50*t186*t102;
    t190 = 0.025507875555556*t7*t10*t55*t189;
    t191 = 1/pow(t4,3.666666666666667);
    t192 = 1/pow(3.141592653589793,4.0);
    t193 = 1/pow(t4,5.333333333333333);
    t194 = 1/pow(t54,3.0);
    t195 = 1/pow(t52,4.0);
    t196 = pow(t57,3.0);
    t197 = -39.2035784329441*t21*t37*(-3.200040277777777*
        t41*t42*t43/pow(t4,3.166666666666667)-1.5358125*t38*t39/pow(t40,
        7.0)-3.720474074074074*t12*t13*t15*t34-1.460562962962963*t7*
        t8*t10*t191)*t58*t59*t9-20278.05670960338*t196*t21*t37*t9/
        (pow(t44,6.0)*pow(t45,3.0))+3782.790366949674*t107*t196*t21*
        t37*t9/pow(t44,5.0)-11.17040628149354*t35*t13*t14*t5*t57*t58*
        t59+8.377804711120154*t35*t13*t14*t27*t109*t58*t59+235.2214705976646*
        t21*t9*t109*t57*t37*t108*t59-16.75560942224031*t35*t13*t14*
        t27*t105*t108*t59-235.2214705976646*t21*t9*t196*t37*t106*t59-
        0.540243047085647*t35*t13*t14*t34*t46-1891.395183474837*t21*
        t9*t109*t57*t37*t106*t107+134.7303835695242*t35*t13*t14*t27*
        t105*t106*t107;
    t198 = pow(t60,3.0);
    t199 = -0.347299101697916*t35*t13*t14*t27*t46-78.40715686588821*
        t21*t9*t57*t37*t58*t59;
    t200 = pow(2.718281828459045,7.313270742351992*t21*t9*
        t37*t46);
    t201 = t4*(23.33333333333333*t25*t3*t31*t99-1666.666666666667*
        t21*t23*t25*t31*t32*t98+4444.444444444444*t25*t31*t35*t95*
        t96*t97-26666.66666666667*t20*t25*t35*t95*t96/pow(t4,10.66666666666667)-
        7.0*t25*t3*t34*t94+200.0*t21*t23*t25*t32*t33*t94+t25*t3*t5*
        (0.006*t19*t29*t92*t93-0.003*t28*t30*t93+0.006*t28*t91*t92-
        0.003*t29*t30*t90-0.001*t19*t30*(-0.332505*t6/pow(t4,4.0)-
        9.046074074074074*t12*t13*t15*t34-1.398518518518518*t7*t8*
        t10*t191)+0.001*t18*(-24.1277037037037*t12*t13*t15*t34-0.021893333333333*
        t7*t8*t10*t191)-0.006*t19*pow(t29,3.0)/pow(t17,4.0))+0.051015751111111*
        t10*t194*pow(t65,3.0)*t7+0.025507875555556*t10*t55*(-15.93860684769776*
        t14*t195*t35*t50*pow(t64,3.0)+2.656434474616293*t14*t35*t53*
        (0.065198711173416*t110*t112*t32*t36*t60*t63-0.304260652142607*
        t111*t112*t32*t56*t63+0.021732903724472*t111*t112*t199*t32*
        t36*t63+0.021732903724472*t112*t198*t32*t36*t63-0.032599355586708*
        t110*t32*t36*t47*t51*t60-0.862071847737385*t104*t32*t47*t51*
        t60+0.152130326071303*t111*t32*t47*t51*t56+0.152130326071303*
        t110*t32*t47*t51*t56-0.010866451862236*t198*t32*t36*t47*t51-
        0.010866451862236*t197*t32*t36*t47*t51-1.91571521719419*t143*
        t32*t49-0.065198711173416*t114*t198*t200*t32*t36-2.106481481481481*
        t14*t193*t3*t35)-2.656434474616293*t14*t35*t50*(-1.619870081083455*
        t35*t22*t32*t143*t51-5.59573002754821*t21*t9*t3*t193*t49-0.220520128685311*
        t198*t200*t22*t32*t35*t36/pow(t48,5.0)-0.055130032171328*t35*
        t22*t32*t36*t110*t60*t63*t47-1.457883072975109*t35*t22*t32*
        t104*t60*t63*t47-0.018376677390443*t35*t22*t32*t36*t198*t63*
        t47-0.018376677390443*t35*t22*t32*t36*t197*t63*t47+0.257273483466196*
        t35*t22*t32*t56*t111*t63*t47+0.257273483466196*t35*t22*t32*
        t56*t110*t63*t47-3.87396694214876*t21*t9*t3*t99*t60*t51*t47-
        0.498081463990555*t21*t9*t3*t5*t110*t60*t51*t47-0.166027154663518*
        t21*t9*t3*t5*t198*t51*t47-0.166027154663518*t21*t9*t3*t5*t197*
        t51*t47+1.162190082644628*t21*t9*t3*t34*t111*t51*t47+1.162190082644628*
        t21*t9*t3*t34*t110*t51*t47-0.99616292798111*t21*t9*t3*t5*t198*
        t114*t200+0.99616292798111*t21*t9*t3*t5*t110*t60*t63*t112+
        0.332054309327037*t21*t9*t3*t5*t198*t63*t112-2.324380165289256*
        t21*t9*t3*t34*t111*t63*t112+0.332054309327037*t21*t9*t3*t5*
        t199*t111*t63*t112+0.165390096513983*t35*t22*t32*t36*t110*
        t60*t114*t112+0.055130032171328*t35*t22*t32*t36*t198*t114*
        t112-0.771820450398587*t35*t22*t32*t56*t111*t114*t112+0.055130032171328*
        t35*t22*t32*t36*t199*t111*t114*t112)*t62+15.93860684769776*
        t35*t14*t50*t102*t64*t115-7.969303423848879*t35*t14*t62*t61*
        t115-7.969303423848879*t35*t14*t62*t64*t113+15.93860684769776*
        t35*t14*t102*t61*t103)*t7+32921.81069958848*t192*t20*t25*pow(t3,
        4.0)/pow(t4,13.33333333333333)+4407.407407407408*t20*t21*t23*
        t25*t32/pow(t4,8.0)-33.7037037037037*t193*t20*t25*t3-0.076523626666667*
        t7*t10*t100*t65*t116)+23.33333333333333*t20*t25*t3*t99-1666.666666666667*
        t20*t21*t23*t25*t32*t98+4444.444444444444*t20*t25*t35*t95*
        t96*t97+3.0*t25*t3*t5*t94-14.0*t25*t3*t31*t34+400.0*t21*t23*
        t25*t31*t32*t33+0.076523626666667*t7*t10*t55*t116-0.076523626666667*
        t7*t10*t100*t101;
    t202 = 1/pow(t4,12.33333333333333);
    t203 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(0.972222222222222*t14*t35*t99*grada+0.086931614897888*
        t111*t112*t3*t36*t63*grada+0.405680869523475*t3*t47*t51*t56*
        t60*grada-0.043465807448944*t111*t3*t36*t47*t51*grada-0.043465807448944*
        t110*t3*t36*t47*t51*grada+1.149429130316514*t104*t3*t49*grada)+
        10.62573789846517*t35*t14*t70*t102*t61*t64+10.62573789846517*
        t35*t14*t50*t102*t120*t64-5.312868949232586*t35*t14*t62*t119*
        t64-5.312868949232586*t35*t14*t62*t61*t120-2.656434474616293*
        t35*t14*t71*t62*t115+5.312868949232586*t35*t14*t50*t70*t102*
        t115-2.656434474616293*t35*t14*t70*t62*t113-2.656434474616293*
        t35*t14*t50*t62*(0.664108618654073*t21*t9*grada*t5*t111*t63*
        t112+0.220520128685311*t35*t22*grada*t3*t36*t111*t114*t112-
        0.332054309327037*t21*t9*grada*t5*t111*t51*t47+1.549586776859504*
        t21*t9*grada*t34*t60*t51*t47-0.332054309327037*t21*t9*grada*
        t5*t110*t51*t47-0.07350670956177*t35*t22*grada*t3*t36*t111*
        t63*t47+0.686062622576522*t35*t22*grada*t3*t56*t60*t63*t47-
        0.07350670956177*t35*t22*grada*t3*t36*t110*t63*t47+2.582644628099174*
        t21*t9*grada*t99*t49+0.971922048650073*t35*t22*grada*t3*t104*
        t51)-15.93860684769776*t35*t14*t50*t70*t195*t103+5.312868949232586*
        t35*t14*t71*t102*t103)+15.55555555555556*t20*t25*t99*grada-
        2611.111111111111*t20*t21*t23*t25*t3*t98*grada+18148.14814814815*
        t20*t25*t32*t35*t95*t97*grada-24691.35802469136*t192*t20*t202*
        t25*t96*grada-2222.222222222222*t118*t25*t31*t32*t35*t95*grada-
        50.0*t21*t23*t25*t3*t67*t94*grada+2.0*t25*t5*t94*grada-9.333333333333334*
        t25*t31*t34*grada+766.6666666666666*t21*t23*t25*t3*t31*t33*
        grada-0.051015751111111*t7*t10*t100*t121*t65-0.025507875555556*
        t7*t10*t72*t100*t116+0.051015751111111*t7*t10*t72*t194*t101)-
        2222.222222222222*t118*t20*t25*t32*t35*t95*grada-100.0*t21*
        t23*t25*t3*t31*t67*grada+4.0*t25*t31*t5*grada-9.333333333333334*
        t20*t25*t34*grada+766.6666666666666*t20*t21*t23*t25*t3*t33*
        grada-0.051015751111111*t7*t10*t72*t100*t65+0.051015751111111*
        t7*t10*t55*t121;
    t204 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(0.972222222222222*t14*t35*t99*gradb+0.086931614897888*
        t111*t112*t3*t36*t63*gradb+0.405680869523475*t3*t47*t51*t56*
        t60*gradb-0.043465807448944*t111*t3*t36*t47*t51*gradb-0.043465807448944*
        t110*t3*t36*t47*t51*gradb+1.149429130316514*t104*t3*t49*gradb)+
        10.62573789846517*t35*t14*t76*t102*t61*t64+10.62573789846517*
        t35*t14*t50*t102*t124*t64-5.312868949232586*t35*t14*t62*t123*
        t64-5.312868949232586*t35*t14*t62*t61*t124-2.656434474616293*
        t35*t14*t77*t62*t115+5.312868949232586*t35*t14*t50*t76*t102*
        t115-2.656434474616293*t35*t14*t76*t62*t113-2.656434474616293*
        t35*t14*t50*t62*(0.664108618654073*t21*t9*gradb*t5*t111*t63*
        t112+0.220520128685311*t35*t22*gradb*t3*t36*t111*t114*t112-
        0.332054309327037*t21*t9*gradb*t5*t111*t51*t47+1.549586776859504*
        t21*t9*gradb*t34*t60*t51*t47-0.332054309327037*t21*t9*gradb*
        t5*t110*t51*t47-0.07350670956177*t35*t22*gradb*t3*t36*t111*
        t63*t47+0.686062622576522*t35*t22*gradb*t3*t56*t60*t63*t47-
        0.07350670956177*t35*t22*gradb*t3*t36*t110*t63*t47+2.582644628099174*
        t21*t9*gradb*t99*t49+0.971922048650073*t35*t22*gradb*t3*t104*
        t51)-15.93860684769776*t35*t14*t50*t76*t195*t103+5.312868949232586*
        t35*t14*t77*t102*t103)+15.55555555555556*t20*t25*t99*gradb-
        2611.111111111111*t20*t21*t23*t25*t3*t98*gradb+18148.14814814815*
        t20*t25*t32*t35*t95*t97*gradb-24691.35802469136*t192*t20*t202*
        t25*t96*gradb-2222.222222222222*t118*t25*t31*t32*t35*t95*gradb-
        50.0*t21*t23*t25*t3*t67*t94*gradb+2.0*t25*t5*t94*gradb-9.333333333333334*
        t25*t31*t34*gradb+766.6666666666666*t21*t23*t25*t3*t31*t33*
        gradb-0.051015751111111*t7*t10*t100*t125*t65-0.025507875555556*
        t7*t10*t78*t100*t116+0.051015751111111*t7*t10*t78*t194*t101)-
        2222.222222222222*t118*t20*t25*t32*t35*t95*gradb-100.0*t21*
        t23*t25*t3*t31*t67*gradb+4.0*t25*t31*t5*gradb-9.333333333333334*
        t20*t25*t34*gradb+766.6666666666666*t20*t21*t23*t25*t3*t33*
        gradb-0.051015751111111*t7*t10*t78*t100*t65+0.051015751111111*
        t7*t10*t55*t125;
    t205 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(0.972222222222222*t14*t35*t99+0.086931614897888*
        t111*t112*t3*t36*t63+0.405680869523475*t3*t47*t51*t56*t60-
        0.043465807448944*t111*t3*t36*t47*t51-0.043465807448944*t110*
        t3*t36*t47*t51+1.149429130316514*t104*t3*t49)+10.62573789846517*
        t35*t14*t84*t102*t61*t64+10.62573789846517*t35*t14*t50*t102*
        t140*t64-5.312868949232586*t35*t14*t62*t135*t64-5.312868949232586*
        t35*t14*t62*t61*t140-2.656434474616293*t35*t14*t87*t62*t115+
        5.312868949232586*t35*t14*t50*t84*t102*t115-2.656434474616293*
        t35*t14*t84*t62*t113-2.656434474616293*t35*t14*t50*t62*(0.664108618654073*
        t21*t9*t5*t111*t63*t112+0.220520128685311*t35*t22*t3*t36*t111*
        t114*t112-0.332054309327037*t21*t9*t5*t111*t51*t47+1.549586776859504*
        t21*t9*t34*t60*t51*t47-0.332054309327037*t21*t9*t5*t110*t51*
        t47-0.07350670956177*t35*t22*t3*t36*t111*t63*t47+0.686062622576522*
        t35*t22*t3*t56*t60*t63*t47-0.07350670956177*t35*t22*t3*t36*
        t110*t63*t47+2.582644628099174*t21*t9*t99*t49+0.971922048650073*
        t35*t22*t3*t104*t51)-15.93860684769776*t35*t14*t50*t84*t195*
        t103+5.312868949232586*t35*t14*t87*t102*t103)+15.55555555555556*
        t20*t25*t99-2611.111111111111*t20*t21*t23*t25*t3*t98+18148.14814814815*
        t20*t25*t32*t35*t95*t97-24691.35802469136*t192*t20*t202*t25*
        t96-2222.222222222222*t118*t25*t31*t32*t35*t95-50.0*t21*t23*
        t25*t3*t67*t94+2.0*t25*t5*t94-0.051015751111111*t7*t10*t100*
        t141*t65-9.333333333333334*t25*t31*t34+766.6666666666666*t21*
        t23*t25*t3*t31*t33-0.025507875555556*t7*t10*t88*t100*t116+
        0.051015751111111*t7*t10*t88*t194*t101)-2222.222222222222*
        t118*t20*t25*t32*t35*t95-100.0*t21*t23*t25*t3*t31*t67-0.051015751111111*
        t7*t10*t88*t100*t65+4.0*t25*t31*t5-9.333333333333334*t20*t25*
        t34+766.6666666666666*t20*t21*t23*t25*t3*t33+0.051015751111111*
        t7*t10*t55*t141;
    t206 = 1/pow(t4,11.33333333333333);
    t207 = t4*(833.3333333333334*t1*t143*t25*t3*t31*t35*t95-
        10833.33333333333*t1*t118*t20*t25*t3*t35*t95+0.025507875555556*
        t10*t55*(-2.656434474616293*t35*t14*t150*t62*t64-15.93860684769776*
        t35*t14*t50*t148*t195*t64+10.62573789846517*t35*t14*t71*t70*
        t102*t64+5.312868949232586*t35*t14*t50*t149*t102*t64-2.656434474616293*
        t35*t14*t149*t62*t61+5.312868949232586*t35*t14*t148*t102*t61+
        2.656434474616293*t14*t35*t53*(-0.086931614897888*t1*t36*t47*
        t51*t60-0.405680869523475*t1*t49*t56+t134+t133+t132)-2.656434474616293*
        t35*t14*t50*t62*(t139+t138-0.14701341912354*t35*t22*t1*t36*
        t60*t63*t47+t137+t136-0.343031311288261*t35*t22*t1*t56*t51)-
        5.312868949232586*t35*t14*t71*t62*t120+10.62573789846517*t35*
        t14*t50*t70*t102*t120-5.312868949232586*t35*t14*t70*t62*t119)*
        t7-200.0*t1*t21*t23*t25*t31*t67+0.051015751111111*t7*t10*t146*
        t194*t65-0.025507875555556*t7*t10*t151*t100*t65+1000.0*t1*
        t20*t21*t23*t25*t33+18518.51851851852*t1*t192*t20*t206*t25*
        t32+t131+t130+t129+t128+t127-0.051015751111111*t7*t10*t72*
        t100*t121)+t81+t80+t152+t147+t145+t144;
    t208 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(-0.086931614897888*t36*t47*t51*t60*grada*gradb-
        0.405680869523475*t49*t56*grada*gradb)+0.390531514790987*t21*
        t156*grada*gradb*t36*t50*t102*t51*t64-0.07350670956177*t35*
        t22*grada*gradb*t36*t62*t49*t64-15.93860684769776*t35*t14*
        t50*t70*t76*t195*t64+5.312868949232586*t35*t14*t71*t76*t102*
        t64+5.312868949232586*t35*t14*t77*t70*t102*t64-0.195265757395493*
        t21*t156*grada*gradb*t36*t62*t51*t61+5.312868949232586*t35*
        t14*t70*t76*t102*t61-2.656434474616293*t35*t14*t50*t62*(-0.14701341912354*
        t35*t22*grada*gradb*t36*t60*t63*t47-0.343031311288261*t35*
        t22*grada*gradb*t56*t51)-2.656434474616293*t35*t14*t71*t62*
        t124+5.312868949232586*t35*t14*t50*t70*t102*t124-2.656434474616293*
        t35*t14*t70*t62*t123-2.656434474616293*t35*t14*t77*t62*t120+
        5.312868949232586*t35*t14*t50*t76*t102*t120-2.656434474616293*
        t35*t14*t76*t62*t119)+833.3333333333334*t143*t25*t3*t31*t35*
        t95*grada*gradb-10833.33333333333*t118*t20*t25*t3*t35*t95*
        grada*gradb-200.0*t21*t23*t25*t31*t67*grada*gradb+1000.0*t20*
        t21*t23*t25*t33*grada*gradb+18518.51851851852*t192*t20*t206*
        t25*t32*grada*gradb+0.051015751111111*t7*t10*t72*t78*t194*
        t65-0.025507875555556*t7*t10*t100*t157*t65-0.025507875555556*
        t7*t10*t72*t100*t125-0.025507875555556*t7*t10*t78*t100*t121)+
        t158+t155+t154+t153;
    t209 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(-0.086931614897888*t36*t47*t51*t60*grada-0.405680869523475*
        t49*t56*grada)+0.390531514790987*t21*t156*grada*t36*t50*t102*
        t51*t64-0.07350670956177*t35*t22*grada*t36*t62*t49*t64-15.93860684769776*
        t35*t14*t50*t84*t70*t195*t64+5.312868949232586*t35*t14*t71*
        t84*t102*t64+5.312868949232586*t35*t14*t87*t70*t102*t64-0.195265757395493*
        t21*t156*grada*t36*t62*t51*t61+5.312868949232586*t35*t14*t84*
        t70*t102*t61-2.656434474616293*t35*t14*t50*t62*(-0.14701341912354*
        t35*t22*grada*t36*t60*t63*t47-0.343031311288261*t35*t22*grada*
        t56*t51)-2.656434474616293*t35*t14*t71*t62*t140+5.312868949232586*
        t35*t14*t50*t70*t102*t140-2.656434474616293*t35*t14*t70*t62*
        t135-2.656434474616293*t35*t14*t87*t62*t120+5.312868949232586*
        t35*t14*t50*t84*t102*t120-2.656434474616293*t35*t14*t84*t62*
        t119)+833.3333333333334*t143*t25*t3*t31*t35*t95*grada-10833.33333333333*
        t118*t20*t25*t3*t35*t95*grada-200.0*t21*t23*t25*t31*t67*grada+
        1000.0*t20*t21*t23*t25*t33*grada+18518.51851851852*t192*t20*
        t206*t25*t32*grada+0.051015751111111*t7*t10*t88*t72*t194*t65-
        0.025507875555556*t7*t10*t100*t164*t65-0.025507875555556*t7*
        t10*t72*t100*t141-0.025507875555556*t7*t10*t88*t100*t121)+
        t165+t161+t160+t159;
    t210 = t4*(833.3333333333334*t143*t2*t25*t3*t31*t35*t95-
        10833.33333333333*t118*t2*t20*t25*t3*t35*t95+0.025507875555556*
        t10*t55*(-2.656434474616293*t35*t14*t172*t62*t64-15.93860684769776*
        t35*t14*t50*t170*t195*t64+10.62573789846517*t35*t14*t77*t76*
        t102*t64+5.312868949232586*t35*t14*t50*t171*t102*t64-2.656434474616293*
        t35*t14*t171*t62*t61+5.312868949232586*t35*t14*t170*t102*t61+
        2.656434474616293*t14*t35*t53*(-0.086931614897888*t2*t36*t47*
        t51*t60-0.405680869523475*t2*t49*t56+t134+t133+t132)-2.656434474616293*
        t35*t14*t50*t62*(t139+t138-0.14701341912354*t35*t22*t2*t36*
        t60*t63*t47+t137+t136-0.343031311288261*t35*t22*t2*t56*t51)-
        5.312868949232586*t35*t14*t77*t62*t124+10.62573789846517*t35*
        t14*t50*t76*t102*t124-5.312868949232586*t35*t14*t76*t62*t123)*
        t7-200.0*t2*t21*t23*t25*t31*t67+0.051015751111111*t7*t10*t168*
        t194*t65-0.025507875555556*t7*t10*t173*t100*t65+1000.0*t2*
        t20*t21*t23*t25*t33+18518.51851851852*t192*t2*t20*t206*t25*
        t32+t131+t130+t129+t128+t127-0.051015751111111*t7*t10*t78*
        t100*t125)+t81+t80+t174+t169+t167+t166;
    t211 = t4*(0.025507875555556*t10*t55*t7*(2.656434474616293*
        t14*t35*t53*(-0.086931614897888*t36*t47*t51*t60*gradb-0.405680869523475*
        t49*t56*gradb)+0.390531514790987*t21*t156*gradb*t36*t50*t102*
        t51*t64-0.07350670956177*t35*t22*gradb*t36*t62*t49*t64-15.93860684769776*
        t35*t14*t50*t84*t76*t195*t64+5.312868949232586*t35*t14*t77*
        t84*t102*t64+5.312868949232586*t35*t14*t87*t76*t102*t64-0.195265757395493*
        t21*t156*gradb*t36*t62*t51*t61+5.312868949232586*t35*t14*t84*
        t76*t102*t61-2.656434474616293*t35*t14*t50*t62*(-0.14701341912354*
        t35*t22*gradb*t36*t60*t63*t47-0.343031311288261*t35*t22*gradb*
        t56*t51)-2.656434474616293*t35*t14*t77*t62*t140+5.312868949232586*
        t35*t14*t50*t76*t102*t140-2.656434474616293*t35*t14*t76*t62*
        t135-2.656434474616293*t35*t14*t87*t62*t124+5.312868949232586*
        t35*t14*t50*t84*t102*t124-2.656434474616293*t35*t14*t84*t62*
        t123)+833.3333333333334*t143*t25*t3*t31*t35*t95*gradb-10833.33333333333*
        t118*t20*t25*t3*t35*t95*gradb-200.0*t21*t23*t25*t31*t67*gradb+
        1000.0*t20*t21*t23*t25*t33*gradb+18518.51851851852*t192*t20*
        t206*t25*t32*gradb+0.051015751111111*t7*t10*t88*t78*t194*t65-
        0.025507875555556*t7*t10*t100*t180*t65-0.025507875555556*t7*
        t10*t78*t100*t141-0.025507875555556*t7*t10*t88*t100*t125)+
        t181+t177+t176+t175;
    t212 = t4*(833.3333333333334*t143*t25*t3*t31*t35*t95-
        10833.33333333333*t118*t20*t25*t3*t35*t95+0.025507875555556*
        t10*t55*(0.390531514790987*t21*t156*t36*t50*t102*t51*t64-0.07350670956177*
        t35*t22*t36*t62*t49*t64-15.93860684769776*t35*t14*t50*t186*
        t195*t64+10.62573789846517*t35*t14*t87*t84*t102*t64-0.195265757395493*
        t21*t156*t36*t62*t51*t61+5.312868949232586*t35*t14*t186*t102*
        t61+2.656434474616293*t14*t35*t53*(-0.086931614897888*t36*
        t47*t51*t60-0.405680869523475*t49*t56)-2.656434474616293*t35*
        t14*t50*t62*(-0.14701341912354*t35*t22*t36*t60*t63*t47-0.343031311288261*
        t35*t22*t56*t51)-5.312868949232586*t35*t14*t87*t62*t140+10.62573789846517*
        t35*t14*t50*t84*t102*t140-5.312868949232586*t35*t14*t84*t62*
        t135)*t7-200.0*t21*t23*t25*t31*t67+0.051015751111111*t7*t10*
        t184*t194*t65-0.025507875555556*t7*t10*t100*t189*t65+1000.0*
        t20*t21*t23*t25*t33+18518.51851851852*t192*t20*t206*t25*t32-
        0.051015751111111*t7*t10*t88*t100*t141)+t190+t185+t183+t182;
    t213 = pow(grada,
        3.0);
    t214 = 1/pow(t4,10.33333333333333);
    t215 = pow(gradb,3.0);

   /* code */
    dfdra = t66;
    dfdrb = t66;
    dfdga = t4*(t73+t69+t68);
    dfdgb = t4*(t79+t75+t74);
    dfdgab = t4*(t89+t81+t80);
    d2fdrara = t117;
    d2fdrarb = t117;
    d2fdraga = t122;
    d2fdragb = t126;
    d2fdraab = t142;
    d2fdrbrb = t117;
    d2fdrbga = t122;
    d2fdrbgb = t126;
    d2fdrbgab = t142;
    d2fdgaga = t4*(t152+t147+t81+t80+t145+t144);
    d2fdgagb = t4*(t158+t155+t154+t153);
    d2fdgagab = t4*(t165+t161+t160+t159);
    d2fdgbgb = t4*(t174+t169+t81+t80+t167+t166);
    d2fdgbgab = t4*(t181+t177+t176+t175);
    d2fdgabgab = t4*(t190+t185+t183+t182);
    d3fdrarara = t201;
    d3fdrararb = t201;
    d3fdraraga = t203;
    d3fdraragb = t204;
    d3fdraraab = t205;
    d3fdrarbrb = t201;
    d3fdrarbga = t203;
    d3fdrarbgb = t204;
    d3fdrarbab = t205;
    d3fdragaga = t207;
    d3fdragagb = t208;
    d3fdragaab = t209;
    d3fdragbgb = t210;
    d3fdragbab = t211;
    d3fdraabab = t212;
    d3fdrbrbrb = t201;
    d3fdrbrbga = t203;
    d3fdrbrbgb = t204;
    d3fdrbrbab = t205;
    d3fdrbgaga = t207;
    d3fdrbgagb = t208;
    d3fdrbgaab = t209;
    d3fdrbgbgb = t210;
    d3fdrbgbab = t211;
    d3fdrbabab = t212;
    d3fdgagaga = t4*(2500.0*t143*t20*t25*t3*t35*t95*grada-
        600.0*t20*t21*t23*t25*t67*grada+5000.0*t143*t20*t213*t25*t35*
        t95+0.051015751111111*t10*t194*t7*pow(t72,3.0)+0.025507875555556*
        t10*t55*t7*(-15.93860684769776*t14*t195*t35*t50*pow(t70,3.0)-
        7.969303423848879*t35*t14*t150*t70*t62-7.969303423848879*t35*
        t14*t71*t149*t62-0.58579727218648*t21*t156*grada*t36*t50*t62*
        t51+0.220520128685311*t35*t22*grada*t36*t53*t49+15.93860684769776*
        t35*t14*t50*t149*t70*t102+15.93860684769776*t35*t14*t71*t148*
        t102)-13888.88888888889*t192*t20*t213*t214*t25*t3-0.076523626666667*
        t7*t10*t151*t72*t100);
    d3fdgagagb = t4*(5000.0*t1*t143*t20*t25*t35*t95*gradb-
        13888.88888888889*t1*t192*t20*t214*t25*t3*gradb+0.051015751111111*
        t7*t10*t146*t78*t194+0.025507875555556*t7*t10*t55*(t179-0.14701341912354*
        t35*t22*grada*gradb*t36*t70*t62*t49+t178-0.390531514790987*
        t21*t156*grada*gradb*t36*t71*t62*t51+0.781063029581974*t21*
        t156*grada*gradb*t36*t50*t70*t102*t51-2.656434474616293*t35*
        t14*t150*t76*t62-2.656434474616293*t35*t14*t77*t149*t62+10.62573789846517*
        t35*t14*t71*t70*t76*t102+5.312868949232586*t35*t14*t50*t149*
        t76*t102+5.312868949232586*t35*t14*t77*t148*t102-15.93860684769776*
        t35*t14*t50*t148*t76*t195)+t176+t175-0.051015751111111*t7*
        t10*t72*t100*t157-0.025507875555556*t7*t10*t151*t78*t100);
    d3fdgagaab = t4*
        (5000.0*t1*t143*t20*t25*t35*t95-13888.88888888889*t1*t192*
        t20*t214*t25*t3+0.051015751111111*t7*t10*t88*t146*t194+0.025507875555556*
        t7*t10*t55*(t188-0.14701341912354*t35*t22*grada*t36*t70*t62*
        t49+t187-0.390531514790987*t21*t156*grada*t36*t71*t62*t51+
        0.781063029581974*t21*t156*grada*t36*t50*t70*t102*t51-2.656434474616293*
        t35*t14*t87*t149*t62-2.656434474616293*t35*t14*t150*t84*t62+
        5.312868949232586*t35*t14*t87*t148*t102+10.62573789846517*
        t35*t14*t71*t84*t70*t102+5.312868949232586*t35*t14*t50*t84*
        t149*t102-15.93860684769776*t35*t14*t50*t84*t148*t195)+t183+
        t182-0.051015751111111*t7*t10*t72*t100*t164-0.025507875555556*
        t7*t10*t88*t151*t100);
    d3fdgagbgb = t4*(5000.0*t143*t2*t20*t25*t35*t95*grada-
        13888.88888888889*t192*t2*t20*t214*t25*t3*grada+0.051015751111111*
        t7*t10*t72*t168*t194+0.025507875555556*t7*t10*t55*(t163-0.14701341912354*
        t35*t22*grada*gradb*t36*t76*t62*t49+t162-0.390531514790987*
        t21*t156*grada*gradb*t36*t77*t62*t51+0.781063029581974*t21*
        t156*grada*gradb*t36*t50*t76*t102*t51-2.656434474616293*t35*
        t14*t172*t70*t62-2.656434474616293*t35*t14*t71*t171*t62+5.312868949232586*
        t35*t14*t71*t170*t102+10.62573789846517*t35*t14*t77*t70*t76*
        t102+5.312868949232586*t35*t14*t50*t171*t70*t102-15.93860684769776*
        t35*t14*t50*t70*t170*t195)+t160+t159-0.051015751111111*t7*
        t10*t78*t100*t157-0.025507875555556*t7*t10*t173*t72*t100);
    d3fdgagbab = t4*
        (5000.0*t143*t20*t25*t35*t95*grada*gradb-13888.88888888889*
        t192*t20*t214*t25*t3*grada*gradb+0.025507875555556*t7*t10*
        t55*(-0.07350670956177*t35*t22*grada*t36*t76*t62*t49-0.07350670956177*
        t35*t22*gradb*t36*t70*t62*t49-0.07350670956177*t35*t22*grada*
        gradb*t36*t84*t62*t49-0.195265757395493*t21*t156*grada*t36*
        t77*t62*t51-0.195265757395493*t21*t156*gradb*t36*t71*t62*t51-
        0.195265757395493*t21*t156*grada*gradb*t36*t87*t62*t51+0.390531514790987*
        t21*t156*grada*t36*t50*t76*t102*t51+0.390531514790987*t21*
        t156*gradb*t36*t50*t70*t102*t51+0.390531514790987*t21*t156*
        grada*gradb*t36*t50*t84*t102*t51+5.312868949232586*t35*t14*
        t87*t70*t76*t102+5.312868949232586*t35*t14*t71*t84*t76*t102+
        5.312868949232586*t35*t14*t77*t84*t70*t102-15.93860684769776*
        t35*t14*t50*t84*t70*t76*t195)+0.051015751111111*t7*t10*t88*
        t72*t78*t194-0.025507875555556*t7*t10*t72*t100*t180-0.025507875555556*
        t7*t10*t78*t100*t164-0.025507875555556*t7*t10*t88*t100*t157);
    d3fdgaabab = t4*
        (5000.0*t143*t20*t25*t35*t95*grada-13888.88888888889*t192*
        t20*t214*t25*t3*grada+0.025507875555556*t7*t10*t55*(-0.07350670956177*
        t35*t22*t36*t70*t62*t49-0.14701341912354*t35*t22*grada*t36*
        t84*t62*t49-0.195265757395493*t21*t156*t36*t71*t62*t51-0.390531514790987*
        t21*t156*grada*t36*t87*t62*t51+0.390531514790987*t21*t156*
        t36*t50*t70*t102*t51+0.781063029581974*t21*t156*grada*t36*
        t50*t84*t102*t51+10.62573789846517*t35*t14*t87*t84*t70*t102+
        5.312868949232586*t35*t14*t71*t186*t102-15.93860684769776*
        t35*t14*t50*t186*t70*t195)+0.051015751111111*t7*t10*t184*t72*
        t194-0.025507875555556*t7*t10*t72*t100*t189-0.051015751111111*
        t7*t10*t88*t100*t164);
    d3fdgbgbgb = t4*(2500.0*t143*t20*t25*t3*t35*t95*gradb-
        600.0*t20*t21*t23*t25*t67*gradb+5000.0*t143*t20*t215*t25*t35*
        t95+0.051015751111111*t10*t194*t7*pow(t78,3.0)+0.025507875555556*
        t10*t55*t7*(-15.93860684769776*t14*t195*t35*t50*pow(t76,3.0)-
        7.969303423848879*t35*t14*t172*t76*t62-7.969303423848879*t35*
        t14*t77*t171*t62-0.58579727218648*t21*t156*gradb*t36*t50*t62*
        t51+0.220520128685311*t35*t22*gradb*t36*t53*t49+15.93860684769776*
        t35*t14*t50*t171*t76*t102+15.93860684769776*t35*t14*t77*t170*
        t102)-13888.88888888889*t192*t20*t214*t215*t25*t3-0.076523626666667*
        t7*t10*t173*t78*t100);
    d3fdgbgbab = t4*(5000.0*t143*t2*t20*t25*t35*t95-13888.88888888889*
        t192*t2*t20*t214*t25*t3+0.051015751111111*t7*t10*t88*t168*
        t194+0.025507875555556*t7*t10*t55*(t188-0.14701341912354*t35*
        t22*gradb*t36*t76*t62*t49+t187-0.390531514790987*t21*t156*
        gradb*t36*t77*t62*t51+0.781063029581974*t21*t156*gradb*t36*
        t50*t76*t102*t51-2.656434474616293*t35*t14*t87*t171*t62-2.656434474616293*
        t35*t14*t172*t84*t62+5.312868949232586*t35*t14*t87*t170*t102+
        10.62573789846517*t35*t14*t77*t84*t76*t102+5.312868949232586*
        t35*t14*t50*t84*t171*t102-15.93860684769776*t35*t14*t50*t84*
        t170*t195)+t183+t182-0.051015751111111*t7*t10*t78*t100*t180-
        0.025507875555556*t7*t10*t88*t173*t100);
    d3fdgbabab = t4*(5000.0*t143*t20*t25*t35*t95*gradb-13888.88888888889*
        t192*t20*t214*t25*t3*gradb+0.025507875555556*t7*t10*t55*(-
        0.07350670956177*t35*t22*t36*t76*t62*t49-0.14701341912354*
        t35*t22*gradb*t36*t84*t62*t49-0.195265757395493*t21*t156*t36*
        t77*t62*t51-0.390531514790987*t21*t156*gradb*t36*t87*t62*t51+
        0.390531514790987*t21*t156*t36*t50*t76*t102*t51+0.781063029581974*
        t21*t156*gradb*t36*t50*t84*t102*t51+10.62573789846517*t35*
        t14*t87*t84*t76*t102+5.312868949232586*t35*t14*t77*t186*t102-
        15.93860684769776*t35*t14*t50*t186*t76*t195)+0.051015751111111*
        t7*t10*t184*t78*t194-0.025507875555556*t7*t10*t78*t100*t189-
        0.051015751111111*t7*t10*t88*t100*t180);
    d3fdababab = t4*(5000.0*t143*t20*t25*t35*t95+0.051015751111111*
        t10*t194*t7*pow(t88,3.0)+0.025507875555556*t10*t55*t7*(-15.93860684769776*
        t14*t195*t35*t50*pow(t84,3.0)-0.58579727218648*t21*t156*t36*
        t87*t62*t51+1.171594544372961*t21*t156*t36*t50*t84*t102*t51-
        0.220520128685311*t35*t22*t36*t84*t62*t49+15.93860684769776*
        t35*t14*t87*t186*t102)-13888.88888888889*t192*t20*t214*t25*
        t3-0.076523626666667*t7*t10*t88*t100*t189);


    ds->df1000 += factor*dfdra;
    ds->df0100 += factor*dfdrb;
    ds->df0010 += factor*dfdga;
    ds->df0001 += factor*dfdgb;
    ds->df00001+= factor*dfdgab;

    ds->df2000 += factor*d2fdrara;
    ds->df1100 += factor*d2fdrarb;
    ds->df1010 += factor*d2fdraga;
    ds->df1001 += factor*d2fdragb;
    ds->df10001+= factor*d2fdraab;
    ds->df0200 += factor*d2fdrbrb;
    ds->df0110 += factor*d2fdrbga;
    ds->df0101 += factor*d2fdrbgb;
    ds->df01001+= factor*d2fdrbgab;
    ds->df0020 += factor*d2fdgaga;
    ds->df0011 += factor*d2fdgagb;
    ds->df00101+= factor*d2fdgagab;
    ds->df0002 += factor*d2fdgbgb;
    ds->df00011+= factor*d2fdgbgab;
    ds->df00002+= factor*d2fdgabgab;

    ds->df3000 += factor*d3fdrarara;
    ds->df2100  += factor*d3fdrararb;
    ds->df2010  += factor*d3fdraraga;
    ds->df2001  += factor*d3fdraragb;
    ds->df20001 += factor*d3fdraraab;
    ds->df1200  += factor*d3fdrarbrb;
    ds->df1110  += factor*d3fdrarbga;
    ds->df1101  += factor*d3fdrarbgb;
    ds->df11001 += factor*d3fdrarbab;
    ds->df1020  += factor*d3fdragaga;
    ds->df1011  += factor*d3fdragagb;
    ds->df10101 += factor*d3fdragaab;
    ds->df1002  += factor*d3fdragbgb;
    ds->df10011 += factor*d3fdragbab;
    ds->df10002 += factor*d3fdraabab;
    ds->df0300  += factor*d3fdrbrbrb;
    ds->df0210  += factor*d3fdrbrbga;
    ds->df0201  += factor*d3fdrbrbgb;
    ds->df02001 += factor*d3fdrbrbab;
    ds->df0120  += factor*d3fdrbgaga;
    ds->df0111  += factor*d3fdrbgagb;
    ds->df01101 += factor*d3fdrbgaab;
    ds->df0102  += factor*d3fdrbgbgb;
    ds->df01011 += factor*d3fdrbgbab;
    ds->df01002 += factor*d3fdrbabab;
    ds->df0030  += factor*d3fdgagaga;
    ds->df0021  += factor*d3fdgagagb;
    ds->df00201 += factor*d3fdgagaab;
    ds->df0012  += factor*d3fdgagbgb;
    ds->df00111 += factor*d3fdgagbab;
    ds->df00102 += factor*d3fdgaabab;
    ds->df0003  += factor*d3fdgbgbgb;
    ds->df00021 += factor*d3fdgbgbab;
    ds->df00012 += factor*d3fdgbabab;
    ds->df00003 += factor*d3fdababab;

}
